<template>
    <view class="detail-list">
      <view class="ul">
        <view class="li" @tap="goHref('healthCard')">
          <view class="left">
            <view class="iconfont icon-jiankangzheng"></view>
            <view class="txt">健康证<strong></strong></view>
          </view>
          <view class="iconfont icon-jiantou-youce right"></view>
        </view>
        <view class="li" @tap="goHref('mySwimTicket')">
          <view class="left">
            <view class="iconfont icon-yongpiao"></view>
            <view class="txt">泳票<strong></strong></view>
          </view>
          <view class="iconfont icon-jiantou-youce right"></view>
        </view>
        <view class="li" @tap="goHref('entryRecord')">
          <view class="left">
            <view class="iconfont icon-ruchangjilu"></view>
            <view class="txt">入场记录<strong></strong></view>
          </view>
          <view class="iconfont icon-jiantou-youce right"></view>
        </view>
      </view>
    </view>
</template>

<script>
import Taro from "@tarojs/taro";
export default {
  data() {
    return {

    }
  },
  created() {
    // 建议在页面初始化时把 getCurrentInstance() 的结果保存下来供后面使用，
    // 而不是频繁地调用此 API
    this.$instance = Taro.getCurrentInstance()
  },
  mounted() {
    // 获取路由参数
    console.log(this.$instance.router.params) // 输出 { id: 2, type: 'test' }
  },
  methods: {
    goHref(txt) {
      if (txt === 'healthCard') {
        Taro.redirectTo({
          url: '/pages/healthCard/index'
        });
      } else if (txt === 'mySwimTicket') {
        Taro.redirectTo({
          url: '/pages/mySwimTicket/index'
        });
      } else if (txt === 'entryRecord') {
        Taro.redirectTo({
          url: '/pages/entryRecord/index'
        });
      }
    },
  }
}
</script>

<style lang="less">
@import url('./static/font-alibb/iconfont.css');
.detail-list {
  width: 96%;
  border-radius: 15rpx;
  background: #fff;
  height: 800rpx;
  margin: 0 auto;

  .ul {
    margin: 0;
    padding: 0;
    margin-top: 10rpx;
    display: flex;
    flex-flow: column;
    justify-content: flex-start;

    .li {
      display: flex;
      justify-content: space-between;
      align-items: center;
      height: 100rpx;
      line-height: 100rpx;
      border-bottom: 1px solid #f5f5f0;
      padding: 0 20rpx;

      .left {
        display: flex;
        justify-content: flex-start;
        align-items: center;

        .txt {
          margin-left: 15rpx;
          font-size: 28rpx;
        }
      }
    }

  }

}
</style>
